#pragma once

#include <cfloat>
#include <cmath>
#include <cstdlib>

namespace D3D10Utils
{
    const float PI = 3.14159265358979323f;
  
    // Returns random float in [0, 1).
    __forceinline float RandF()
    {
        return static_cast<float> ( (rand()) / static_cast<float>(RAND_MAX) );
    }

    // Returns random float in [a, b).
    __forceinline float RandF(const float a, const float b)
    {
        return a + RandF() * (b - a);
    }

    // Get height (y-coord) based on x and z coordinates.
    __forceinline float getHeight(const float x, const float z)
    {
        return 0.3f * ( z * sinf(0.1f * x) + x * cosf(0.1f * z) );
    }

    // Returns the polar angle of the point (x,y) in [0, 2*PI).
    float AngleFromXY(const float x, const float y); 
}
